import {Pipe, PipeTransform,NgModule} from '@angular/core';


@Pipe({name: 'values'})
export class ValuesPipe implements PipeTransform {
  transform(value, args:string[]) : any {
    let keys = [];
    for (let key in value) {
      keys.push(key);
    }
    return keys;
  }
}

@Pipe({name: 'encode'})
export class encodePipe implements PipeTransform {
  transform(value, args:string[]) : any {
    return encodeURIComponent(JSON.stringify(value));
  }
}

@NgModule({
  declarations: [
    ValuesPipe,
    encodePipe
  ],
  exports: [ValuesPipe,encodePipe]
})

export class IterableModule { }
